import pygame


# Skeleton guard's spell(remote)
class GuardStar:
    # pass guard's coordinate, because the spell is generated at the position of guard
    def __init__(self, enemy, player):
        # load image resource
        self.image = pygame.image.load(r"image/enemy_star.png")
        # set spell speed
        self.star_speed = 5

        # initial location
        self.x = enemy.coord_x
        self.y = enemy.coord_y

        delta_x = player.coord_x - self.x
        delta_y = player.coord_y - self.y
        total_dis = pow(pow(delta_x, 2) + pow(delta_y, 2), 0.5)
        self.dir_x = delta_x / total_dis
        self.dir_y = delta_y / total_dis









